# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kservice
pkgver=6.7.0
pkgrel=0
pkgdesc="Advanced plugin and service introspection"
arch="all"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-only AND LGPL-2.1-or-later"
depends_dev="
	kconfig-dev
	kcoreaddons-dev
	kcrash-dev
	kdbusaddons-dev
	ki18n-dev
	"
makedepends="$depends_dev
	bison
	doxygen
	extra-cmake-modules
	flex-dev
	graphviz
	kdoctools-dev
	qt6-qttools-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/frameworks/kservice.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kservice-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_TESTING=ON \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure -E "kapplicationtradertest|ksycocathreadtest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
caf8127eae2c50d259e116296d1f5b71be277f7a930dfa57cb39eb396462f184d296f72563df3b134cf67a0f563587aa296bb82978aa6f23f33680bff039a9e9  kservice-6.7.0.tar.xz
"
